package com.fyzk.activity.zoushitu;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.tyjc.lottery.R;


public class MyLinearLayout1 extends LinearLayout{
	
	private View view;
	private TextView tv;
	private RelativeLayout rl;
	
	private Context context;

	public MyLinearLayout1(Context context){
		this(context,null);
		this.context = context;
	}
	
	public MyLinearLayout1(Context context, AttributeSet attrs) {
		super(context, attrs);
		
		view = LayoutInflater.from(context).inflate(R.layout.zoushitu_qiu, null);
		rl = (RelativeLayout)view.findViewById(R.id.zoushi_qiu_rl);
		tv = (TextView)view.findViewById(R.id.zoushi_qiu_tv);
		this.addView(view);
	}
	
	public void setRL(int width,int height){
		rl.getLayoutParams().width = width;
		rl.getLayoutParams().height = height;
	}
	
	public void setRLBackground(int id){
		rl.setBackgroundColor(this.context.getResources().getColor(id));
	}
	
	public void setText(String text){
		tv.setText(text);
	}
	
	public void setTextBackground(int id){
		tv.setBackgroundResource(id);
	}
	
	public void setTextColor(int id){
		tv.setTextColor(this.context.getResources().getColor(id));
	}

}
